package paas.storage.distributedColumnDatabase;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class IProperties {
    public static final String token = "DMUUAQCBOPXYNKDXZZPY|WYlpKih9nNMUMTTYYu5MDmRv5Nm3ydG9eE5pUBBw";
    public static String ServiceID = "cln-sjy6bt8e"; // hbase database master
    public static String ExpendParams;
    public static String WrongExpendParams;
    public static String database = "test";
    public static String DefaultFs = "hdfs://192.168.5.7:9000";
    public static String WrongDefaultFs = "hdfs://192.168.5.7:9999";

/* "hadoop": {
        "fs.defaultFS": "hdfs://192.168.5.2:9000",
                "dfs.replication": "1",
                "dfs.support.append": "true",
                "user": "root"
    },
            "hbase": {
        "hbase.zookeeper.quorum": "192.168.5.8:2181,192.168.5.9:2181,192.168.5.10:2181",
                "zookeeper.znode.parent": "/hbase/cl-mkt9vpfu",
                "hbase.rootDir": "hdfs://cln-3rk8cvap:9000/hbase",
                "hbase.zookeeper.quorum.port": "2181"
    }*/

    public IProperties() {
        Map<String, Object> hbase = new HashMap<>();
        //hbase
        hbase.put("hbase.rootDir", DefaultFs + "/hbase");
        hbase.put("zookeeper.znode.parent", "/hbase/cl-5e9xsuxf");
        hbase.put("hbase.zookeeper.quorum", "192.168.5.9:2181,192.168.5.10:2181,192.168.5.8:2181");
        hbase.put("hbase.zookeeper.quorum.port", "2181");
        //hadoop
        Map<String, Object> hadoop = new HashMap<>();
        System.setProperty("HADOOP_USER_NAME", "root");
        hadoop.put("fs.defaultFS", DefaultFs);
        hadoop.put("dfs.support.append", "true");
        hadoop.put("dfs.replication", "2");
        hadoop.put("user", "root");

        Map<String,Map<String,Object>> config = new HashMap<>();
        config.put("hbase",hbase);
        config.put("hadoop",hadoop);

        this.ExpendParams = JSONObject.toJSONString(config);

        Map<String, Object> wrongHbase = new HashMap<>();
        //hbase
        wrongHbase.put("hbase.rootDir", WrongDefaultFs + "/hbase");
        wrongHbase.put("zookeeper.znode.parent", "/hbase/cl-5e9xsuxf");
        wrongHbase.put("hbase.zookeeper.quorum", "192.168.5.9:2181,192.168.5.10:2181,192.168.5.8:2181");
        wrongHbase.put("hbase.zookeeper.quorum.port", "2181");
        //hadoop
        Map<String, Object> wrongHadoop = new HashMap<>();
        System.setProperty("HADOOP_USER_NAME", "root");
        wrongHadoop.put("fs.defaultFS", WrongDefaultFs);
        wrongHadoop.put("dfs.support.append", "true");
        wrongHadoop.put("dfs.replication", "2");
        wrongHadoop.put("user", "root");

        Map<String,Map<String,Object>> wrongConfig = new HashMap<>();
        wrongConfig.put("hbase",wrongHbase);
        wrongConfig.put("hadoop",wrongHadoop);

        this.WrongExpendParams = JSONObject.toJSONString(wrongConfig);


        //创建表参数
    }
}
